<template>
    <div class="app-container">
      <!-- 左侧导航 -->
      <div class="sidebar">
        <div class="logo-container">
          <img src="/picture/Technology.jpg" alt="Logo" class="logo-image">
        </div>
        <nav class="nav-menu">
          <a href="#" class="nav-item nav-item--active">
            <i class="fas fa-user nav-icon"></i>
            <span>个人信息</span>
          </a>
          <a href="#" class="nav-item">
            <i class="fas fa-clipboard-list nav-icon"></i>
            <RouterLink to="/exam"><span>学习进度</span></RouterLink>
          </a>
          <a href="#" class="nav-item">
            <i class="fas fa-chart-bar nav-icon"></i>
            <span>成绩查询</span>
          </a>
          <a href="#" class="nav-item">
            <i class="fas fa-calendar-alt nav-icon"></i>
            <span>课程表</span>
          </a>
          <a href="#" class="nav-item">
            <i class="fas fa-cog nav-icon"></i>
            <span>系统设置</span>
          </a>
        </nav>
      </div>
      <!-- 右侧内容区 -->
      <div class="main-content">
        <!-- 顶部导航 -->
        <header class="top-header">
          <div class="breadcrumb">
            <a href="#" class="breadcrumb-home">首页</a>
            <i class="fas fa-chevron-right breadcrumb-separator"></i>
            <span class="breadcrumb-current">个人信息维护</span>
          </div>
          <div class="header-right">
            <div class="help-icon">
              <i class="fas fa-question-circle"></i>
            </div>
            <div class="user-profile">
              <span class="user-name"></span>
              <i class="fas fa-chevron-down user-dropdown-icon"></i>
            </div>
          </div>
        </header>
        <!-- 表单内容 -->
        <div class="form-container">
          <h2 class="form-title">个人信息维护</h2>
          <form @submit.prevent="handleSubmit" class="info-form">
            <div class="form-grid">
              <!-- 姓名 -->
              <div>
                <label class="form-label">
                  姓名
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.name" type="text" class="form-input" required>
              </div>
              <!-- 学号 -->
              <div>
                <label class="form-label">
                  学号
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.studentId" type="text" class="form-input" required>
              </div>
              <!-- 性别 -->
              <div>
                <label class="form-label">
                  性别
                  <span class="required-mark">*</span>
                </label>
                <div class="flex gap-6">
                  <label class="flex items-center">
                    <input type="radio" v-model="formData.gender" value="female" class="mr-2">
                    女
                  </label>
                  <label class="flex items-center">
                    <input type="radio" v-model="formData.gender" value="male" class="mr-2">
                    男
                  </label>
                </div>
              </div>
              <!-- 出生日期 -->
              <div>
                <label class="form-label">
                  出生日期
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.birthday" type="date" class="form-input" required>
              </div>
              <!-- 手机号码 -->
              <div>
                <label class="form-label">
                  手机号码
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.phone" type="tel" class="form-input" required>
              </div>
              <!-- 电子邮箱 -->
              <div>
                <label class="form-label">
                  电子邮箱
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.email" type="email" class="form-input" required>
              </div>
              <!-- QQ号码 -->
              <div>
                <label class="form-label">QQ号码</label>
                <input v-model="formData.qq" type="text" class="form-input">
              </div>
              <!-- 专业 -->
              <div>
                <label class="form-label">
                  专业
                  <span class="required-mark">*</span>
                </label>
                <select v-model="formData.major" class="form-input" required>
                  <option value="">请选择专业</option>
                  <option value="电子信息工程(电力电子技术方向)">电子信息工程(电力电子技术方向)</option>
                  <option value="应用电子技术">应用电子技术</option>
                  <option value="计算机应用技术">计算机应用技术</option>
                  <option value="计算机网络技术">计算机网络技术</option>
                  <option value="软件技术">软件技术</option>
                  <option value="物联网应用技术">物联网应用技术</option>
                </select>
              </div>
              <!-- 班级 -->
              <div>
                <label class="form-label">
                  班级
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.class" type="text" class="form-input" required>
              </div>
              <!-- 入学年份 -->
              <div>
                <label class="form-label">
                  入学年份
                  <span class="required-mark">*</span>
                </label>
                <input v-model="formData.enrollmentYear" type="text" class="form-input" required>
              </div>
            </div>
            <div class="button-group">
              <button type="button" @click="handleReset" class="button-reset">重置</button>
              <button type="submit" class="button-submit">保存修改</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </template>
  
  <script lang="ts" setup>
  import { ref } from 'vue';
  import { ElMessage } from 'element-plus';
  const formData = ref({
    name: '',
    studentId: '',
    gender: '',
    birthday: '',
    phone: '',
    email: '',
    qq: '',
    // department: '', // 删除了所属院系字段
    major: '',
    class: '',
    enrollmentYear: ''
  });
  
  const handleSubmit = () => {
  console.log('提交表单:', formData.value);
  ElMessage.success('保存成功！');
};
  
  const handleReset = () => {
    formData.value = {
      name: '',
      studentId: '',
      gender: '',
      birthday: '',
      phone: '',
      email: '',
      qq: '',
      // department: '', // 删除了所属院系字段
      major: '',
      class: '',
      enrollmentYear: ''
    };
  };
  </script>
  
  <style scoped>
  .app-container {
    min-height: 100vh;
    background-color: #f8fafc;
    font-family: 'Helvetica Neue', Arial, sans-serif;
  }
  
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    background-color: #1a1f37;
    color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  }
  
  .logo-container {
    padding: 24px;
    text-align: center;
  }
  
  .logo-image {
    width: 128px;
    border-radius: 8px;
  }
  
  .nav-menu {
    margin-top: 24px;
  }
  
  .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    text-decoration: none;
    color: white;
    transition: background-color 0.3s;
  }
  
  .nav-item:hover {
    background-color: #1f2937;
  }
  
  .nav-item--active {
    background-color: #3b82f6;
    border-radius: 8px;
  }
  
  .nav-icon {
    margin-right: 12px;
    font-size: 18px;
  }
  
  .main-content {
    margin-left: 240px;
    padding: 24px;
  }
  
  .top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background-color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
  }
  
  .breadcrumb {
    display: flex;
    align-items: center;
    color: #4b5563;
  }
  
  .breadcrumb-home {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.3s;
  }
  
  .breadcrumb-home:hover {
    color: #3b82f6;
  }
  
  .breadcrumb-separator {
    margin: 0 8px;
    font-size: 12px;
  }
  
  .header-right {
    display: flex;
    align-items: center;
  }
  
  .notification-icon, .help-icon {
    position: relative;
    margin-right: 16px;
    color: #9ca3af;
    font-size: 18px;
  }
  
  .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: #ef4444;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .user-profile {
    display: flex;
    align-items: center;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid white;
  }
  
  .user-name {
    color: #374151;
    font-weight: 500;
  }
  
  .user-dropdown-icon {
    margin-left: 8px;
    font-size: 12px;
    color: #9ca3af;
  }
  
  .form-container {
    padding: 32px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 24px;
  }
  
  .form-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    color: #1a1f37;
  }
  
  .info-form {
    max-width: 1024px;
  }
  
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 48px;
  }
  
  .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
  }
  
  .required-mark {
    color: #ef4444;
    margin-left: 2px;
  }
  
  .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 14px;
  }
  
  .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  }
  
  .button-group {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
    gap: 16px;
  }
  
  button {
    padding: 12px 24px;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 14px;
    font-weight: 500;
  }
  
  .button-reset {
    border: 1px solid #d1d5db;
    background-color: transparent;
    color: #374151;
  }
  
  .button-reset:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
  }
  
  .button-submit {
    background-color: #3b82f6;
    color: white;
    border: none;
  }
  
  .button-submit:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
  }
  .router-link-active {
  text-decoration: none;
  color: #fff;
}
a {
  text-decoration: none;
  color: #fff;
}

  </style>